// https://nuxt.com/docs/api/configuration/nuxt-config
import { resolve } from 'pathe'
import {
  pinia,
  piniaPersistedstate,
  vant,
  elementPlus,
  postcss,
  i18n,
} from './nuxt.modules'

export default defineNuxtConfig({
  css: [
    '~/assets/css/tailwind.scss',
    '~/assets/css/common.scss',
    '~/assets/css/transition.scss',
  ],
  ssr: true,
  pages: true,
  router: {
    options: {
      strict: true, // 严格的（指/）
    },
  },
  modules: [
    '@vant/nuxt',
    '@vueuse/nuxt',
    '@nuxtjs/i18n',
    '@hypernym/nuxt-gsap',
    'nuxt-icon',
    'nuxt-lodash',
    '@element-plus/nuxt',
    '@pinia/nuxt',
    '@pinia-plugin-persistedstate/nuxt',
  ],
  pinia,
  piniaPersistedstate,
  vant,
  elementPlus,
  postcss,
  i18n,

  build: {},
  alias: {
    imgs: resolve(__dirname, './assets/images'),
  },
  app: {
    head: {
      title: 'ykxbc',
      htmlAttrs: {
        lang: 'zh-CN',
      },
      charset: 'utf-8',
      meta: [],
      link: [],
      script: [],
      noscript: [{ children: 'JavaScript is required' }],
    },
    pageTransition: {
      name: 'page-trans',
      mode: 'out-in',
    },
  },
  generate: {},
  vite: {
    base: './',
  },
  devServer: {
    port: 3669,
  },
  plugins: ['~/plugins/0.provide.client.ts', '~/plugins/0.auth.client.ts'],
})
